package com.wo2record.user.action;

import org.springframework.beans.factory.annotation.Autowired;

import com.opensymphony.xwork2.ActionSupport;
import com.wo2record.base.action.BaseAction;
import com.wo2record.user.model.UserLogin;
import com.wo2record.user.service.UserLoginService;

public class UserLoginAction extends BaseAction {

	private static final long serialVersionUID = -7114826004290478365L;

	@Autowired
	private UserLoginService userLoginService;
	
	private UserLogin userLogin;

	public String creatingUser(){
		//TODO here may add some picture for generating validation code.
		return "goto_user_creationg_page";
	}
	
	public String save() throws Exception{
		try{
			userLoginService.saveObject(userLogin);
			return ActionSupport.SUCCESS;
		}catch(Exception e){
			throw e;
		}
	}
	
	// Getter and Setter
	public UserLogin getUserLogin() {
		return userLogin;
	}
	public void setUserLogin(UserLogin userLogin) {
		this.userLogin = userLogin;
	}
}
